﻿Public Class hotellist
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If Request.Params("Tag") = "" Or Request.Params("Tag") = Nothing Then
            SqlDataSource1.SelectCommand = "SELECT DISTINCT [ID], [HotelName], [Location], [Stars], [Description], [ContactDetails], [Picture], [HotelUrl] FROM [hotellist]"
        Else
            SqlDataSource1.SelectCommand = "SELECT DISTINCT [ID], [HotelName], [Location], [Stars], [Description], [ContactDetails], [Picture], [HotelUrl] FROM [HotelTagView] WHERE ([Tag] = ?)"
        End If
        SqlDataSource1.DataBind()

        If User.IsInRole("superuser") Then
            ph_SuperUsers.Visible = True
        Else
            ph_SuperUsers.Visible = False
        End If
    End Sub

    Protected Function getStars(ByVal stars As Integer)
        Dim retval As String
        retval = ""
        For i = 1 To stars
            retval = retval + ":)"
        Next
        Return retval
    End Function


End Class